const mysql = require('mysql')

// 导入配置文件
const DBCOMFIG = require('../comfig/dbcomfig')

const connection = mysql.createConnection({
   host: DBCOMFIG.HOST,
   user: DBCOMFIG.USER,
   password: DBCOMFIG.PASSWORD,
   database: DBCOMFIG.DATABASES
})

connection.connect()

// 导出数据库
module.exports = connection